<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="question3.css"  rel="stylesheet">
    <script type="text/javascript">
        function chkAll(obj){
            var a = document.getElementsByName("chk");
            for(var i in a){
                a[i].checked = obj.checked;
            }
        }


        function changeChk(obj){
            var chkAll = document.getElementById("chkAll");
            if(!obj.checked){
                chkAll.checked=false;
            }else{
                var a = document.getElementsByName("chk");
                var flag = true;
                for(var i=0;i<a.length;i++){
                    if(!a[i].checked){
                        flag = false;
                        break;
                    }
                }
                chkAll.checked=flag;
            }

        }
    </script>
</head>
<body>
<div id="body">
    <div class="head">
        <div class="d1"><input type="checkbox" id="chkAll" onclick="chkAll(this)"/>全选</div>
        <div class="d2">商品图片</div>
        <div class="d3">商品名称/出售者/联系方式</div>
        <div class="d4">价格</div>
    </div>
    <div class="head1">
        <div class="d1"><input type="checkbox" name="chk" value="1" onclick="changeChk(this)"/></div>
        <div class="d2"><img src="img/list0.jpg"></div>
        <div class="d3">
            <p>杜比环绕，家庭影院必备，超真实感受</p>
            <p>出售者：ling112233</p>
            <p><img src="img/online_pic.gif">&nbsp;&nbsp;&nbsp;<img src="img/list_tool_fav1.gif">收藏</p>
        </div>
        <div class="d4">
            <p>一口价</p>
            <p>2833.0</p>
        </div>
    </div>
    <div class="head1">
        <div class="d1"><input type="checkbox" name="chk" value="2" onclick="changeChk(this)"/></div>
        <div class="d2"><img src="img/list1.jpg"></div>
        <div class="d3">
            <p>NVDIA&nbsp;9999GT&nbsp;512MB&nbsp;256bit极品显卡，不容错过</p>
            <p>出售者：aipiaopiao110</p>
            <p><img src="img/online_pic.gif">&nbsp;&nbsp;&nbsp;<img src="img/list_tool_fav1.gif">收藏</p>
        </div>
        <div class="d4">
            <p>一口价</p>
            <p>6464.0</p>
        </div>
    </div>
    <div class="head1">
        <div class="d1"><input type="checkbox" name="chk"  value="3" onclick="changeChk(this)"/></div>
        <div class="d2"><img src="img/list2.jpg"></div>
        <div class="d3">
            <p>精品热卖，高清晰，30寸等离子电视</p>
            <p>出售者：阳光的挣扎</p>
            <p><img src="img/online_pic.gif">&nbsp;&nbsp;&nbsp;<img src="img/list_tool_fav1.gif">收藏</p>
        </div>
        <div class="d4">
            <p>一口价</p>
            <p>18888.0</p>
        </div>
    </div>
    <div class="head1">
        <div class="d1"><input type="checkbox" name="chk"  value="4" onclick="changeChk(this)"/></div>
        <div class="d2"><img src="img/list3.jpg"></div>
        <div class="d3">
            <p>Sony索尼家用最新款笔记本</p>
            <p>出售者：疯狂的镜无</p>
            <p><img src="img/online_pic.gif">&nbsp;&nbsp;&nbsp;<img src="img/list_tool_fav1.gif">收藏</p>
        </div>
        <div class="d4">
            <p>一口价</p>
            <p>5889.0</p>
        </div>
    </div>
</div>

</body>
</html>